#pragma once
#include "ProSurface.h"
#include <memory>
#include "wCollection.hpp"
#include <vector>
#include "wProContour.hpp"

namespace witotk{



class wProSurface:public wOHandle<ProSurface>
{
public:

	wProSurface(ProSurface suf):wOHandle<ProSurface>(suf)
	{
		
	}

	wProContourCollection_ptr GetContours()
	{
		typedef std::vector<ProContour> ProContours_T;
		ProError error = PRO_TK_NO_ERROR;
		struct ProSurfaceContourVisitAction_cls
		{
			static ProError ProSurfaceContourVisitAction 
				( ProContour  p_contour,
				ProError    /*status*/,
				ProAppData  app_data
				)
			{
				ProContours_T * ct = (ProContours_T*)app_data;
				ct->push_back(p_contour);
				return PRO_TK_NO_ERROR;
			} 
		};
		
		ProContours_T contours;
		error = ProSurfaceContourVisit    (m_data,ProSurfaceContourVisitAction_cls::ProSurfaceContourVisitAction ,NULL,(ProAppData   )&contours);
		if(error != PRO_TK_NO_ERROR )
		{
			return wProContourCollection_ptr();
		}	
		else
		{
			return wProContourCollection_ptr(new wProContourCollection(contours));
		}
	}

};

typedef	std::tr1::shared_ptr<wProSurface> wProSurface_ptr;


}